import App from './App'
import uView from "uview-ui";
Vue.use(uView);
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
import { platform } from '@/config/platform.js';
import store from '@/store/index.js';
import config from '@/config/appidConfig.js'
import request from '@/utils/request.js';
import utils from '@/utils/utils.js';
import popupAd from './core/popupAd.js';
import $const from '@/core/const.js';
import platDiff from '@/core/platDiff.js';
import event from '@/core/event.js';
import ShaWx from '@/utils/showfeng.js'
import mallConfig from '@/core/mallConfig.js';
import * as cache from '@/core/cache.js';
// 商品列表组件
import ProductList from '@/components/product_list/product_list.vue'
import AuthOrize from '@/components/authorize/authorize.vue'
import CommoDity from '@/components/commodity/commodity.vue'
Vue.component('ProductList',ProductList)
Vue.component('AuthOrize',AuthOrize)
Vue.component('CommoDity',CommoDity)
Vue.use({
  install(Vue, options) {
    Vue.prototype.$platform = platform; // 平台
    Vue.prototype.$store = store;// 数据池  
    Vue.prototype.$request = request; // 请求
    Vue.prototype.$utils = utils; // 工具函数
	Vue.prototype.$imgurl = config.imgurl;
    Vue.prototype.$const = $const; // 常量
    Vue.prototype.$event = event; // 事件
    Vue.prototype.$platDiff = platDiff; // 平台差异性
    Vue.prototype.$storage = cache; // 缓存
    Vue.prototype.$popupAd = popupAd;
    Vue.prototype.$user = user; // 用户组件
    Vue.prototype.$mallConfig = mallConfig; // 商城配置
    Vue.prototype.$onLaunched = new Promise(resolve => {
      Vue.prototype.$isResolve = resolve
    })
    // #ifdef H5
    Vue.prototype.$jwx = jwx;
    // #endif
  },
});
import user from '@/core/user.js'
const app = new Vue({
  ...App,
  store
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif